package com.sxjh.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sxjh.common.ResultException;
import com.sxjh.entity.File;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.concurrent.CompletableFuture;

public interface FileService extends IService<File> {

    /**
     * 保存文件
     */
    @Deprecated
    String saveFile(MultipartFile file) throws Exception;

    /**
     * 下载文件
     *
     * @param code 文件编码
     */
    ResponseEntity download(String code) throws RuntimeException;

    /**
     * 保存文件(调用php接口)
     */
    CompletableFuture<String> savePhpFile(MultipartFile file) throws ResultException, IOException;
}
